package com.hengxinguotong.zhihuichengjian.bean;

import com.hengxinguotong.zhihuichengjian.treeview.Node;

import java.io.Serializable;

/**
 * Created by HQOCSHheqing on 2016/8/2.
 *
 * @description 部门类（继承Node），此处的泛型Integer是因为ID和parentID都为int
 * ，如果为String传入泛型String即可
 */
public class StructureBean extends Node<String> implements Serializable{

    private String id;//部门ID
    private String pId;//父亲节点ID
    private String name;//部门名称

    public StructureBean() {
    }

    /**
     * 此处返回节点ID
     * @return
     */
    @Override
    public String get_id() {
        return id;
    }

    /**
     * 此处返回父亲节点ID
     * @return
     */
    @Override
    public String get_parentId() {
        return pId;
    }

    @Override
    public String get_label() {
        return name;
    }

    @Override
    public String get_startTime() {
        return null;
    }

    @Override
    public String get_endTime() {
        return null;
    }

    @Override
    public String get_status() {
        return null;
    }

    @Override
    public float get_percent() {
        return 0;
    }

    @Override
    public void set_percent(float percent) {

    }

    @Override
    public int get_planDays() {
        return 0;
    }

    @Override
    public int get_realDays() {
        return 0;
    }

    @Override
    public boolean parent(Node dest) {
        if (id.equals((String)dest.get_parentId())){
            return true;
        }
        return false;
    }

    @Override
    public boolean child(Node dest) {
        if (pId.equals((String) dest.get_id())){
            return true;
        }
        return false;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }


    public String getpId() {
        return pId;
    }

    public void setpId(String pId) {
        this.pId = pId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

}
